package toanstt.com.MatchUp;


import toanstt.com.MatchUp.R;
import toanstt.com.MatchUp.R.raw;
import android.media.MediaPlayer;

public class Sound1
{
	MediaPlayer media;
	public Sound1()
	{
		media =MediaPlayer.create(MainActivity.context,R.raw.theme);
		media.setLooping(true);
		Setvolum();
	}
	
	public void Play()
	{
		try
		{
	     media.start();
		}
		catch(Exception e)
		{
			
		}
	  }
	public void Pause()
	{
		try
		{
	
		media.pause();
		}
		catch(Exception e)
		{
			
		}
	}
	public void Stop()
	{
		try
		{
		media.stop();
		}
		catch(Exception e)
		{
			
		}
	}
	public void Setvolum()
	{
		
		float a = (T.SOUND)*1.0f/5;
		if(a == 0.2f)
			a = 0.15f;
		else if(a == 0.4f)
			a = 0.25f;
		else if(a == 0.6f)
			a = 0.45f;
		media.setVolume(a, a);
	}
}
